package com.yx.changdao.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.github.liaochong.myexcel.core.annotation.IgnoreColumn;
import com.yx.changdao.common.annotation.AutoFill;
import com.yx.changdao.common.utils.SysUtils;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;


@TableName(GridInfo.TABLE_NAME)
@Getter
@Setter
public class GridInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 数据库名
     */
    public static final String TABLE_NAME = "grid_info";
    public static final String GRID_NUM = "grid_num";
   /**
    * 网格id
    */
    public static final String ID = "id";

    /**
     * 村/社区id
     */
    public static final String VILLAGE_ID = "village_id";
    /**
     * 导入建筑表格时的唯一id
     */
    public static final String GRID_BUILD_ID="grid_build_id";


   /**
    * 网格名称
    */
    public static final String GRID_NAME = "grid_name";
   /**
    * 楼栋数
    */
    public static final String BUILD_NUMBER = "build_number";
   /**
    * 沿街商铺数(初期无法统计，录入)
    */
    public static final String SHOP_NUMBER = "shop_number";
   /**
    * 平房区片数(初期无法统计，录入)
    */
    public static final String BUNGALOW_NUMBER = "bungalow_number";
   /**
    * 网格员姓名
    */
    public static final String GRIDMAN_NAME = "gridman_name";
   /**
    * 网格员身份证
    */
    public static final String GRIDEMAN_CARD = "grideman_card";
   /**
    * 网格员电话
    */
    public static final String GRIDMAN_PHONE = "gridman_phone";
   /**
    * 创建时间
    */
    public static final String CREATE_TIME = "create_time";
   /**
    * 创建人
    */
    public static final String CREATE_BY_NAME = "create_by_name";
   /**
    * 创建人id
    */
    public static final String CREATE_BY = "create_by";
   /**
    * 更新时间
    */
    public static final String UPDATE_TIME = "update_time";
   /**
    * 更新人
    */
    public static final String UPDATE_BY_NAME = "update_by_name";
   /**
    * 更新人id
    */
    public static final String UPDATE_BY = "update_by";
    /**
     * 村居名
     */
    public static final String VILLAGE_COMMITTEE = "village_committee";



   /**
    * 网格id
    */
    @TableId(type = IdType.AUTO)
    @IgnoreColumn
    private Integer id;
    /**
     *导入建筑时的唯一id
     * 这个字段暂时废弃，当时导入时用这个来关联，结果用网格编号了
     */
    @IgnoreColumn
    private String  gridBuildId;
   /**
    * 网格名称
    */
    @NotNull(message = "网格名不允许为空")
    @ExcelColumn(index = 0,title = "网格名")
    private String gridName;
    @IgnoreColumn
    private Integer villageId;
    /**
     * 网格编号
     */
    @NotNull(message = "网格编号不允许为空")
    @ExcelColumn(index = 1,title = "网格编号")
    private String gridNum;
   /**
    * 楼栋数
    */
   @IgnoreColumn
    private Integer buildNumber;
   /**
    * 沿街商铺数(初期无法统计，录入)
    */
   @IgnoreColumn
    private Integer shopNumber;
   /**
    * 平房区片数(初期无法统计，录入)
    */
   @IgnoreColumn
    private Integer bungalowNumber;
   /**
    * 网格员姓名
    */
   @IgnoreColumn
    private String gridmanName;
   /**
    * 网格员身份证
    */
   @IgnoreColumn
    private String gridemanCard;
   /**
    * 网格员电话
    */
   @IgnoreColumn
    private String gridmanPhone;
    /**
     * 村居名
     */
    @IgnoreColumn
    private String villageCommittee;

   /**
    * 创建时间
    */
    @AutoFill
    @TableField(fill = FieldFill.INSERT)
    @IgnoreColumn
    private Date createTime;
    /**
     * 创建人
     */
    @AutoFill(klass= SysUtils.class,method = "currentUserName")
    @TableField(fill = FieldFill.INSERT)
    @IgnoreColumn
    private String createByName;
   /**
    * 创建人id
    */
   @AutoFill(klass= SysUtils.class,method = "currentUserId")
   @TableField(fill = FieldFill.INSERT)
   @IgnoreColumn
    private String createBy;
   /**
    * 更新时间
    */
    @AutoFill
    @TableField(fill = FieldFill.UPDATE)
    @IgnoreColumn
    private Date updateTime;
    /**
     * 更新人
     */
    @AutoFill(klass= SysUtils.class,method = "currentUserName")
    @TableField(fill = FieldFill.UPDATE)
    @IgnoreColumn
    private String updateByName;
   /**
    * 更新人id
    */
   @AutoFill(klass= SysUtils.class,method = "currentUserId")
   @TableField(fill = FieldFill.UPDATE)
   @IgnoreColumn
    private String updateBy;


    /**
     * 临时字段
     */
    //楼栋数（计算）
    @TableField(exist = false)
    @IgnoreColumn
    private Integer countBuildNumber;

}
